package com.maksdu.LactiveMQ.domain;

import java.util.HashMap;
import java.util.Map;

import com.maksdu.LactiveMQ.broker.LactiveBroker;
import com.maksdu.LactiveMQ.host.AbstractHostSecretary;

import lombok.Getter;
import lombok.Setter;

public class MessageHost {

	/**
	 * 消息主机名
	 */
	@Getter
	@Setter
	private String hostName;
	
	@Getter
	@Setter
	private short type;
	
	@Getter
	@Setter
	private AbstractHostSecretary sectary;
	
	/**
	 * 为提高性能选择非线程安全，线程安全由LactiveBroker 和 sectary 负责
	 */
	private Map<String, LactiveBroker> brokers = new HashMap<>();
	
	public LactiveBroker getBroker(String topic) {
		return brokers.get(topic);
	}
}
